package cn.ly.jmockittest.test;

import cn.ly.jmockittest.Dao;
import cn.ly.jmockittest.LoginDao;
import cn.ly.jmockittest.Service;
import cn.ly.jmockittest.Status;
import cn.ly.jmockittest.util.MockTool;
import cn.ly.jmockittest.util.ServiceTool;
import mockit.Injectable;
import mockit.Tested;
import mockit.integration.junit4.JMockit;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

/**
 * Created by liuyu21 on 2017/10/22.
 */
@RunWith(JMockit.class)
public class ServiceState {
    @Injectable
    private Dao dao;
    @Injectable
    private LoginDao loginDao;
    @Tested
    private Service service;

    @Test
    public void test() {
        try {
            //ServiceTool.serviceSetter(service);
            System.out.println("=====");
            Assert.assertEquals(Status.SELLINGWELL, service.checkStatus("FFF",Long.parseLong("1")));
        }catch (Exception e){
            e.printStackTrace();
        }
    }

}
